/**
 * Created by ls-PC on 2016/7/26.
 */

var moment = require('moment');
module.exports = function (orm, db) {
    var Appointment=db.define('appointment',{
        userDoctor:{type: 'number', rational: false},
        userPatient:{type: 'number', rational: false},
        availableTime:{ type: 'date', required: true, time: true },
        availableAddress:String,
        type:{type: 'number', rational: false},
        information:String

    },{
            methods:{
                serialize: function (){
                    return{
                        id:this.id,
                        userDoctor:this.userDoctor,
                        userPatient:this.userPatient,
                        availableTime:this.availableTime,
                        availableAddress:this.availableAddress,
                        type:this.type,
                        information:this.information
                    }
                }
            }

    })
}
